#ifndef __JUSTIN_BEEPER_H
#define __JUSTIN_BEEPER_H
#include "delay.h"

#define Beeper_UnitTime_ms 10//蜂鸣器的一个数组元素的代表的单位时间（如：在函数里面输入鸣响时间20，单位时间10ms，则实际鸣响200ms）
#define Beeper_Routine 500//蜂鸣器支持的最高鸣响周期
#define Beep PBout(9) // PB9
void Beeper_Init(void);
void Beeper_Control(void);
void Beeper_RingCmd(u16 Ring_10ms,u16 Mute_10ms,u16 Repetition);
void Beeper_ConstantRingCmd(u16 Ring_10ms,u16 Mute_10ms);
void Beeper_Warning(u16 Ring_10ms,u16 Mute_10ms,u16 Repetition,u16 RoutineInterval);
void Beeper_Mute(void);

extern unsigned char Beeper_Switch[Beeper_Routine];//1--off,0--on
extern unsigned char Flag_ConstantRing;
extern unsigned char Flag_MuteLock;
extern unsigned char Flag_RingInitFinished;
extern u16 Beeper_SingleRoutine;
extern unsigned int Beeper_SwitchCounter;
extern int Beeper_Repetition,Beeper_RepetitionCounter;


#endif
